{extend name="public/base"/} {block name="body"}
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/checkout.css" />
<style>
.mui-btn-block{
  padding: 5px;
  border: 1px solid #ccc !important;
  margin: 5px;
  -webkit-appearance: none;
}

.fill-section {
    padding-left: 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.fill-section li {
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.fill-section li:last-child {
    border-bottom: none;
}
.fill-type {
    float: left;
    line-height: 44px;
}

.customer-section .fill-type {
    width: 50px;
}

.customer-section .fill-section-right {
    margin-left: 50px;
}

.fill-phone-right {
    position: relative;
}

.fill-input {
    width: 100%;
    height: 44px !important;
    line-height: 38px !important;
    border: 0 !important;
    font-size: 14px;
    padding: 0 !important;
}

.customer-gender {
    border-top: 1px solid #f0f0f0;
    height: 44px;
}

.customer-gender-choice {
    float: left;
    width: 50%;
    height: 44px;
    line-height: 44px;
    padding-left: 10px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.customer-gender-choice .i-circle {
    float: left;
    width: 16px;
    height: 16px;
    line-height: 16px;
    border: 1px solid #999;
    margin: 12px 8px 0 0;
}

.customer-gender-check .i-circle {
    width: 18px;
    height: 18px;
    line-height: 18px;
    border: 0;
    background-color: #ffd300;
    text-align: center;
    color: #6b450a;
    font-size: 14px;
    font-family: 'iconfonts';
}

.customer-gender-check .i-circle:before {
    content: '\e61a';
}

.address-section .fill-section-right {
    display: block;
    height: 44px;
    margin-left: 105px;
}

.addr-icon {
    float: left;
    margin-top: 10px;
    color: #888;
}

.addr-choose {
    display: block;
    padding: 0 !important;
    line-height: 44px !important;
    height: 44px !important;
    font-size: 13px;
    color: #333;
    border: 0 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto !important;

}

.addr-arrow {
    float: right;
    margin: 16px 12px 0 0;
    width: 10px;
    height: 10px;
    border: 1px solid #ddd;
    border-width: 1px 1px 0 0;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    transform: rotate(45deg);
}

.addr-save-btn {
    width: 93%;
    height: 44px;
    margin: 15px auto;
    background-color: #fff;
    color: #fa9700;
    font-size: 16px;
    line-height: 44px;
    text-align: center;
}

.addr-tip-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 44px;
    z-index: 10;
    display: none;
    background-color: #f8f8f8;
    border: 1px solid #eaeaea;
}

.addr-tip-list li {
    height: 40px;
    padding: 3px 0 3px 3px;
    border-bottom: 1px solid #eaeaea;
}

.addr-tip-list li p {
    height: 40px;
    line-height: 40px;
    padding-left: 13px;
    color: #2f2f2f;
}

.addr-tip-list li.tip-selected p {
    height: 40px;
    background-color: #eaeaea;
}

.addr-tip-list li.tip-hide {
    display: none;
}
ul, ol {
    padding-left: 0;
    list-style-type: none;
}
</style>
<div id="content">
<header class="mui-bar mui-bar-nav" style="z-index:7">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">添加用户信息</h1>
</header>
<div class="mui-content ">
  <h5 style="margin:10px 5px;">联系人</h5>
  <div class="formbloack username" >
      <div class="label-wrap" >用户名</div>
      <div class="input-group-wrap" >
          <div class="input-wrap" style="    padding: .173333rem 0;"> <input type="text" style="margin-bottom: 0;    padding-left: 0;" placeholder="用户名" name="username" value="{$info.username}" > </div>
          </div>
      </div>
  </div>
  <div class="formbloack phone" >
      <div class="label-wrap" >手机</div>
      <div class="input-group-wrap rightbtn">
          <div class="input-wrap" style="    padding: .173333rem 0;"> <input placeholder="手机号" type="text" name="phone" value="{$info.phone}" style="margin-bottom: 0;    padding-left: 0;"> </div>
      </div>
  </div>
  <input type="hidden" value="{$info.id}" name="id" />
  <div class="form-button-wrap" > <button class="form-button" type="button" id="addAddress" >提 交</button> </div>

</div>
</div>

{/block}
{block name="script"}


<script type="text/javascript">


  $(function(){



    $('#addAddress').click(function(){
          var username = $.trim($('[name="username"]').val()),
              phone = $.trim($('[name="phone"]').val()),
              id =  $.trim($('[name="id"]').val());

         if (!username){
           mui.toast('请输入用户名')
           return;
         }
         if (!phone) {
            mui.toast("请输入电话号码！");
            return;
          }

         $.post("{:url('index/address/addqiye', ['cid'=>$cid ])}", {
           "id": id,
           "username": username,
           "phone": phone
         }, function(data) {
             if(data.code == 1){
               setTimeout(function() {
                 window.location.href="{:url('index/cart/qiye', ['cid'=>$cid ])}"
               }, 1000);
             }
             mui.toast(data.msg)
         }, "json");
    })

  })
</script>
{/block}
